$(function () {
    obj.init();
});

var obj = new JsFun();
function JsFun() {
    return {
        dataGrid: null,
        form: null,
        type: null,
        addLogin: null,
        schoolId: null,
        purpose: null,
        init: function () {
            this.type     = xhTool.getQuery('type');
            this.addLogin     = xhTool.getQuery('addLogin');
            this.schoolId     = xhTool.getQuery('schoolId');
            if (this.type === '1'){
                this.purpose = 1;
            } else if (this.type === '2'){
                this.purpose = 3;
            }
            this.dataGrid = new xhDataGrid($('#list'), 'Device/getRegister',{purpose: this.purpose, schoolId: this.schoolId, addLogin:this.addLogin});
            this.dataGrid.parseToolbar().init();
            this.form = new xhForm($('#xh_form'));
            this.form.parse();
        }
    }
}